﻿@using Atacadao.Comum.Pesquisa;
@{
    CampoPesquisa atributoPesquisa = Atacadao.Web.Metadata.MetaDados.RecuperarAtributos<CampoPesquisa>(this.ViewData);
    MascaraAttribute atributoMascara = Atacadao.Web.Metadata.MetaDados.RecuperarAtributos<MascaraAttribute>(this.ViewData);
    Dictionary<string, object> atributos = new Dictionary<string, object>();

    if (atributoMascara != null)
    {
        atributos.Add("mascara", atributoMascara.Mascara);
    }

    atributos.Add("class", "texto textoMascara");
}
@Html.TextBox("",(object) this.Model, (IDictionary<string,object>) atributos)
@if (atributoPesquisa != null)
{    
    <input type="hidden" value="@atributoPesquisa.TipoPesquisa|@atributoPesquisa.Campo|@atributoPesquisa.Campo2|" id="@("p_hd" + ViewData.TemplateInfo.HtmlFieldPrefix)" name="@("p_hd" + ViewData.TemplateInfo.HtmlFieldPrefix)"/>
}